import { BoxGeometry, Mesh, MeshStandardMaterial, Object3D } from "three";
import { pictrueTexture } from "./tTextures";

export const basicObjects: Object3D[] = [];

// plane
const plane: Mesh = new Mesh(
    new BoxGeometry(600,10,400),
    new MeshStandardMaterial({
        color: 0x9c9c9c,
        roughness: 0
    })
)
plane.position.y = -5
// 接收阴影
plane.receiveShadow = true

// Box
const box: Mesh = new Mesh(
    new BoxGeometry(20,20,20),
    new MeshStandardMaterial({
        color: 0xffffff,
        metalness: 0.5,
        roughness: 0,
        map: pictrueTexture
    })
)
box.position.y = 10
// 产生阴影
box.castShadow = true

// 墙面
export const wall: Mesh = new Mesh(
    new BoxGeometry(600,200,10),
    new MeshStandardMaterial({
        color: 0xffffff,
        roughness: 0
    })
)
wall.position.y = 100
wall.position.z = -80
wall.updateMatrix()
wall.updateMatrixWorld()
// 接收阴影
wall.receiveShadow = true
// wall.addEventListener("mouseenter", (event)=>{
//     console.log('mouseenter',event)
// })
// wall.addEventListener("mousemove", (event)=>{
//     console.log('mousemove',event)
// })
// wall.addEventListener("mouseleave", (event)=>{
//     console.log('leave', event)
// })

basicObjects.push(plane, wall)